﻿using System;
using System.Diagnostics.Contracts;
using System.IO;

namespace Server.Packets
{
    /// <summary>
    /// Define the contracts of the <see cref="T:Server.Packets.Packet" /> class.
    /// </summary>
    [ContractClassFor(typeof(Packet))]
    public abstract class PacketContracts : Packet
    {
        #region Methods

        /// <summary>
        /// Reads the raw packet data from a data reader.
        /// </summary>
        /// <param name="reader">Data reader.</param>
        protected override void ReadPacketData(BinaryReader reader)
        {
            Contract.Requires<ArgumentNullException>(reader != null);
        }

        /// <summary>
        /// Write the raw packet data to a data writer.
        /// </summary>
        /// <param name="writer">Data writer.</param>
        protected override void WritePacketData(BinaryWriter writer)
        {
            Contract.Requires<ArgumentNullException>(writer != null);
        }

        #endregion
    }
}
